package com.example.mybatisplusstudy.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.example.mybatisplusstudy.annotation.Notes;
import com.example.mybatisplusstudy.enums.DesenEnum;
import lombok.*;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author code威
 * @version 1.0
 * @description: 用户对象
 * @date 2022/5/4 10:43
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class User {


    @TableId(type = IdType.AUTO)
    private Long id;

    @Notes(desc = "姓名",rule = DesenEnum.NAME)
    private String name;

    private Integer age;

    private String email;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdDate;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedDate;

    @Version//乐观锁（版本号）
    private Integer version;

    @TableLogic//逻辑删除
    private Integer isDeleted;
}
